import java.util.Arrays;
import java.util.stream.Collectors;

public class LeetCode557 {
    public static void main(String[] args) {
        System.out.println(reverseWords("Let's take LeetCode contest"));
    }

    public static String reverseWords(String s) {
        return Arrays.stream(s.split(" ")).map(s1 -> new StringBuilder(s1).reverse().toString()).collect(Collectors.joining(" "));
    }


    public static String reverseWords1(String s) {
        return null;
    }

}
